package StudyCode.summary.mycollection;

import java.util.ArrayList;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class CopyAllElementsOfArrayListToAnObjectArray {
	public static void main(String[] args) {
		ArrayList arrayList = new ArrayList();
		arrayList.add("1");
		arrayList.add("2");
		arrayList.add("3");
		arrayList.add("4");
		arrayList.add("5");

		Object[] objArray = arrayList.toArray();

		System.out.println("复制到 object 数组后:");
		for (int index = 0; index < objArray.length; index++)
			System.out.println(objArray[index]);
	}
}
